<?php
/**
 * @file
 * Retreives the current user's Facebook locale.
 *
 * Usage:
 *  - A page that wants to retreive the current user's Facebook locale should
 *    include/require this page once and only once.
 *
 * Parameter(s):
 *  - $PATH_COMMON : Relative path from the calling page to the 'common'
 *                   directory (e.g. '../common/').
 *
 * Global variable(s) set:
 *  - $fb_locale : The current user's Facebook locale.
 *
 * Global variable(s) unset:
 *  - None.
 *
 * Exception(s):
 *  - None.
 *
 * This file includes/requires:
 *  - fb_user_uid.php
 */

// constant(s) =================================================================
//! Field name of 'locale'.
define("FB_FIELD_LOCALE", "locale");

// implementation ==============================================================
// get the user's facebook user id
require_once $PATH_COMMON . "php/fb_user_uid.php";

// get current user's locale
$fb_locale = $fb->api_client->users_getInfo($fb_uid, FB_FIELD_LOCALE);
$fb_locale = $fb_locale[0][FB_FIELD_LOCALE];
?>
